home *** CD-ROM | disk | FTP | other *** search
- Orc's collection of tiny-little
- utilities of limited value unless
- you run your ST via a shell in
- the auto folder. Part 2
-
- These programs are released to the public domain. You may do anything
- you wish to them or with them. If you modify one of the programs to
- make it more useful, please release your changes to the public domain
- as well.
-
- CMP: compare two binary files
- Usage: cmp [-s] file1 file2
-
- Cmp does a bytewise compare of two files, showing you (in dump format)
- a listing of the differences between them. If it finds no differences,
- it silently returns with status 0. If there are differences, it shows
- all of them and returns one of the following statuses:
-
- 1 - cannot open file1
- 2 - cannot open file2
- 3 - file1 ends before file2
- 4 - file2 ends before file1
-
- If you specify the -s option, cmp will run silently; it will not show
- any of the differences, but will return the appropriate status. Silence
- also enables two other statuses:
-
- 3 - first different byte in file1 < file2
- 4 - first different byte in file2 < file1
-
-
- DEPEND: Build makefile dependency lists from grep output.
- Usage: grep "^#[\s\t]*include" file [...] | depend >> makefile
-
- Depend is designed to sit in a pipeline with a grep -nl and generate
- dependency lists of the form
-
- file.o: include-files file.c
-
- so you can better deal with generating and maintaining makefiles.
- The example given for usage assumes you're running a shell that
- supports i/o redirection and pipelines (like the teeny-shell); if
- you don't have such a shell, you can't get depend to work, because
- it takes its input from standard input and puts it output to
- standard output.
-
- GREP: Find patterns in files
- Usage: grep [-cElnsv] [-] pattern [file ...]
-
- Grep looks for regular expression patterns in the given files (or
- on standard input if there are no such patterns) and shows the lines
- that contain matches. If you are searching multiple files, grep will
- also tell you the file where the matching line was found. Grep also
- returns a status on whether it made a match on the last file checked:
-
- 0: found a match.
- 1: no matches.
- 2: couldn't open the file.
- 255: bad usage.
-
- The patterns grep uses are a subset of that of the Un*x utility grep;
- they are:
- ^: matches the start of a line
- $: matches the end of a line
- [set]: matches any character in set (for example, [abc] matches
- the letter a, b, or c)
- .: matches any character.
- *: matches zero or more of the previous character (.* matches
- any number of characters)
- \<: matches the beginning of an alphanumeric word.
- \>: matches the end of an alphanumeric word.
- \n: matches the newline character
- \r: matches the return character
- \t: matches the tab character
- \f: matches the formfeed character
- \s: matches a space.
- \: escapes special meaning for the following character.
-
- all other characters match themselves.
-
- For example, the pattern foo matches any line with the string foo in
- it. ^foo matches any line with foo at the start of it, and foo$ matches
- any line with foo at the end of it. [ab][cd] matches lines containing
- the string ac, ad, bc, and bd. ab* matches a, ab, abb, abbbbbb.
-
- Grep has a collection of options:
- -c: grep will not show matching lines, but tell you how many matches
- were found.
- -E: Emphasis. Shows the matching patterns in reverse video. (This is
- only applicable on the ST console.)
- -l: grep will not show matching lines, but will tell you the files
- where it found matches.
- -n: give the line number where the pattern was found.
- -s: grep will be completely silent. You may interrogate the return
- status for information (like the -s option for cmp, above)
- -v: only show lines that do not match the pattern.
-
- If you're reading from standard input, the -l option is ignored.
-
- PRINTENV: show your current environment
- Usage: printenv
-
- Printenv prints the contents of your environment as best as it can.
- It will probably become confused with MWC ARGC= strings, and it has
- troubles with 'tag' environment variables.
-
- STIME: set the system date and time
- Usage: stime HRMNDYMOYR
-
- Stime sets the GEMDOS and the BIOS clocks to the specified date.
-
- STRINGS: show asciz strings in a file or standard input
- Usage: strings [-lx] - show strings in standard input
- strings [-lx] file - show strings in file.
-
- Strings shows all strings (sequences of printable characters terminated
- by a null or newline) that appear in the input stream; a string is x
- (passed by the -l argument; default is 2) or more printable characters
- followed by a newline or a null.
-
- TOUCH: update modification date on a collection of files
- Usage: touch [HRMNDYMO[YR]] file [file ...]
-
- Touch updates the modification date on a file to the current date or
- a specified date. If the file does not exist, it is created and the
- modification date is set to the specified date.
-
- TEE: pipe fitting
- Usage: tee file
-
- Tee takes its standard input and duplicates it, sending one copy to
- the given file and the other copy to its standard output. It's useful
- inside of a shell pipeline for getting a archival copy of what's going
- on inside that pipeline.
-